package com.lfz.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

/**
 * @author lfz
 * @date 2025/3/6 9:11
 */
@Data
@Entity
@TableName("population_news")
public class PopulationNews implements Serializable{
    @Id
    @TableId(type = IdType.AUTO) // 关键配置：自增策略
    @TableField("id")
    private Integer id;         //id
    private String title;       //新闻标题
    private String content;     //新闻内容
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;    //新闻时间
    private String pubulishby;   //发布人，发布单位
}